import IconFont from '@/components/IconFont';
import SetColumns from './SetColumns.jsx';
import { Button } from 'antd';
import { useState } from 'react';

//表格列设置
const SetTableColumns = ({ defaultColumns, realColumns, updateColumns }) => {

  const [visible, setVisible] = useState(false);

  const SetColumnsProps = {
    defaultColumns,
    realColumns,
    updateColumns,
    handleCancel() {
      setVisible(false);
    }
  }

  return (
    <>
      <Button type="text" onClick={() => setVisible(true)}>
        <IconFont type="icona-lujing12" />
        列表设置
      </Button>
      {visible && <SetColumns {...SetColumnsProps} />}
    </>
  )
}

export default SetTableColumns;